from django.db import models

# Create your models here.
class Sj(models.Model):
    mobile=models.CharField(max_length=11,verbose_name='手机号')
    class Meta:
        verbose_name_plural='手机号'
        db_table='sj'
    def __str__(self):
        return self.mobile

class Xq(models.Model):
    name=models.CharField(max_length=22,verbose_name='名字')
    sfz=models.CharField(max_length=18,verbose_name='身份证')
    xb=models.CharField(max_length=2,verbose_name='性别')
    rq=models.CharField(max_length=20,verbose_name='出生日期')
    sj=models.ForeignKey(Sj,on_delete=models.CASCADE,verbose_name='联系电话')
    jzdz=models.CharField(max_length=50,verbose_name='居住地址')
    na=models.CharField(max_length=20,verbose_name='与本人关系')
    class Meta:
        verbose_name_plural='详情'
        db_table='xq'
    def __str__(self):
        return self.name